package sushidiscount
import org.grails.rateable.*

class Discount implements Rateable {

    SushiPlace sushiplace
    int percentage
    String payform
    String membership
    String aplicable
    String delivery
    boolean monday
    boolean tuesday
    boolean wednesday
    boolean thursday
    boolean friday
    boolean saturday
    boolean sunday


    static constraints = {
        sushiplace()
        percentage()
        payform()
        membership()
        aplicable()
        delivery()
        monday()
        tuesday()
        wednesday()
        thursday()
        friday()
        saturday()
        sunday()
        percentage(inList:[5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100])
        payform(inList:["","Efectivo o tarjeta","Sólo efectivo"])
        membership(inList:["","Socio El Mercurio", "Socio La Tercera" ])
        aplicable(inList:["","Sólo rolls","Toda la carta"])
        delivery(inList:["","Sólo local","Local y despacho a domicilio"])
    }
    def greaterThan()
    {
        if(percentage>50)
        {
            return true
        }
        else
        {
            return false
        }
    }
}
